﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Control.Bus;

namespace QuanLyKho
{
    public partial class FrmChooseProd : Form
    {
        private string resuilt;
        public string Resuilt
        {
            get { return resuilt; }
        }
        public FrmChooseProd()
        {
            InitializeComponent();
            List<BusProduct> prods = new List<BusProduct>();
            prods = BusProduct.GetAll();
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = prods;
            
        }
        private void btThoat_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btOK_Click(object sender, EventArgs e)
        {
            resuilt = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            this.Close();
        }

        private void dataGridView1_DoubleClick(object sender, EventArgs e)
        {
            resuilt = dataGridView1.SelectedRows[0].Cells[0].Value.ToString();
            this.Close();
        }

    }
}
